feat(browserstack-service): stamp hook_run_uuid on App A11y scans fired inside hooks [APPA11Y-5542]#48
Open
AakashHotchandani wants to merge 1 commit into
Open
feat(browserstack-service): stamp hook_run_uuid on App A11y scans fired inside hooks [APPA11Y-5542]#48AakashHotchandani wants to merge 1 commit into
AakashHotchandani wants to merge 1 commit into
Conversation
…ed inside hooks [APPA11Y-5542] App A11y scans fired inside test hooks (before/after, beforeEach/afterEach) were dropped or misattributed. The SDK now stamps the hook's run UUID (thHookRunUuid) on scans fired inside a supported hook, so SeleniumHub (appAllyHandler, PR #14162) relays it as hook_run_uuid and app-accessibility reconciles the scan onto the wrapping test case. Additive: in-test scans are unchanged (field dropped when absent). - util: _getParamsForAppAccessibility / performA11yScan thread optional hookRunUuid (thHookRunUuid) - insights-handler: expose getCurrentHook() so a11y reuses the HookRunStarted uuid (= hook BTCER uuid) - accessibility-handler: beforeHook/afterHook set _currentHookRunUuid + enable the scan gate during mocha hook windows (per-test hooks honour include/exclude scope; suite hooks use autoScanning) - service: wire accessibilityHandler.beforeHook/afterHook, passing the shared hook uuid - tests: cover hook-uuid stamp/clear + unsupported-framework no-op Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
App A11y scans fired inside test hooks (
before/after,beforeEach/afterEach) are dropped or misattributed today. This makes the SDK stamp the hook's run UUID (thHookRunUuid) on scans fired inside a supported hook.How
util.ts—_getParamsForAppAccessibility(commandName, testName, hookRunUuid?)addsthHookRunUuid(dropped byJSON.stringifywhen undefined, so in-test scans are byte-for-byte unchanged);performA11yScan(…, hookRunUuid?)threads it.insights-handler.ts— exposegetCurrentHook()so a11y reuses the same UUID reported to TestHub asHookRunStarted(= the hook's BTCERuuid).accessibility-handler.ts—beforeHook/afterHookset_currentHookRunUuidfor the hook window and, for mocha, enable the scan gate during hooks (per-test hooks honour include/exclude scope; suite hooks useautoScanning);commandWrapperpasses the hook uuid intoperformA11yScan.service.ts— wireaccessibilityHandler.beforeHook/afterHook, passing the shared hook uuid.Backend contract
SeleniumHub
appAllyHandler(PR #14162,APPA11Y-5542-hook-run-uuid) destructuresthHookRunUuidand relays it ashook_run_uuid; app-accessibility reconciles the scan onto the wrapping test via the BTCER self-join. Additive at every hop — no field ⇒ unchanged in-test behaviour.Scope
Gated on
frameworkSupportsHook(mocha before/after/beforeEach/afterEach; cucumber uuid-stamped, its scan gate stays owned bybeforeScenario).Tests
Added hook-scan unit tests (stamp/clear + unsupported-framework no-op). Note: local
tsccouldn't fully run against a v8node_moduleson the v9mainbase — CI validates on v9 deps.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
🤖 Generated with Claude Code